package com.csce.domain.entity.exam;

import com.csce.domain.entity.exam.vo.Checked;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.osce.common.annotation.Excel;
import com.osce.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

/**
 * 考试管理对象 ex_exam
 *
 * @author zzx
 * @since 2023-08-09
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
@EqualsAndHashCode(callSuper = true)
public class ExExam extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 名称
     */
    @Excel(name = "名称")
    @ApiModelProperty("名称")
    @NotBlank(message = "名称不可为空")
    private String name;

    /**
     * 总题数
     */
    @Excel(name = "总题数")
    @ApiModelProperty("总题数")
    private Integer questionCount;


    /**
     * 时长
     */
    @Excel(name = "时长")
    @ApiModelProperty("时长")
    private Integer duration;

    /**
     * 预约
     */
    @Excel(name = "预约")
    @ApiModelProperty("预约")
    private Integer appoint;

    /**
     * 固定组卷
     */
    @Excel(name = "固定组卷")
    @ApiModelProperty("固定组卷")
    private Integer fixed;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("开始时间")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("结束时间")
    private Date endTime;

    /**
     * 预留字段1
     */
    @ApiModelProperty("预留字段1")
    private String reservedOne;

    /**
     * 预留字段2
     */
    @ApiModelProperty("预留字段2")
    private String reservedTwo;

    /**
     * 创建-策略
     */
    @NotBlank(message = "请输入策略")
    private String sig;

    /**
     * 创建-选中范畴及数量
     */
    List<Checked> checkeds;

    /**
     * 查询-题目数量
     */
    private List<Long> questionIds;

    public ExExam setQuestionIds(List<Long> questionIds) {
        this.questionIds = questionIds;
        return this;
    }

}
